# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Content.V2.Model.Address do
  @moduledoc """


  ## Attributes

  *   `administrativeArea` (*type:* `String.t`, *default:* `nil`) - Required. Top-level administrative subdivision of the country. For example, a state like California ("CA") or a province like Quebec ("QC").
  *   `city` (*type:* `String.t`, *default:* `nil`) - Required. City, town or commune. May also include dependent localities or sublocalities (e.g. neighborhoods or suburbs).
  *   `country` (*type:* `String.t`, *default:* `nil`) - Required. [CLDR country code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml)(e.g. "US").
  *   `postalCode` (*type:* `String.t`, *default:* `nil`) - Required. Postal code or ZIP (e.g. "94043"). Required.
  *   `streetAddress` (*type:* `String.t`, *default:* `nil`) - Street-level part of the address.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :administrativeArea => String.t() | nil,
          :city => String.t() | nil,
          :country => String.t() | nil,
          :postalCode => String.t() | nil,
          :streetAddress => String.t() | nil
        }

  field(:administrativeArea)
  field(:city)
  field(:country)
  field(:postalCode)
  field(:streetAddress)
end

defimpl Poison.Decoder, for: GoogleApi.Content.V2.Model.Address do
  def decode(value, options) do
    GoogleApi.Content.V2.Model.Address.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Content.V2.Model.Address do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
